<!--
 * @Author: your name
 * @Date: 2022-01-17 13:58:38
 * @LastEditTime: 2022-01-17 14:25:27
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \custom-app\src\modules\FormCenter\components\conditionNode\index.vue
-->
<template>
  <div class="flow-editor-node condition">
    <div class="flow-editor-node-container">
      <div class="node-title node-title-condition">
        <div class="node-title-name">
          {{ nodeConfig.title || LANG.DEFAULT }}
        </div>
        <!-- <span class="node-title-priority">{{nodeConfig.priority ? '优先级' + nodeConfig.priority : ''}}</span> -->
        <!-- <span class="node-title-priority">{{'优先级' + (branch_index +1)}}</span> -->
      </div>
      <div
        class="node-content"
        :class="{ 'node-content-placeholder': nodeConfig.priority != '' }"
      >
        <div class="node-detail">
          <div class="node-detail-item">
            <div v-if="!isDefault">
              {{
                nodeConfig.condition ? LANG.VIEW_CONDITION : LANG.SET_CONDITION
              }}
            </div>
            <div v-else>{{ LANG.DEFAULT }}</div>
          </div>
        </div>
        <i class="iconfont-approval-admin icon-arrow"></i>
      </div>
      <svg-icon
        v-if="!isDefault && !$attrs.diagramMode"
        class="delete-btn"
        icon-class="close"
      ></svg-icon>
    </div>
    <div class="bottom-v-line"></div>
    <div v-if="!$attrs.diagramMode" class="add-node-btn"></div>
  </div>
</template>

<script>
export default {
  name: 'conditionNode',
  props: {
    nodeConfig: {
      type: Object,
      default: () => {
        return {}
      }
    },
    node_index: {
      type: Number,
      default: 0
    },
    branch_index: {
      type: Number,
      default: 0
    }
  },
  data() {
    return {
      iscreateProcessForm:
        this.$route.path && this.$route.path.includes('createProcessForm')
    }
  },
  watch: {
    branch_index() {
      // this.$set(this.nodeConfig, 'priority', this.branch_index + 1)
    }
  },
  computed: {
    isDefault() {
      return this.nodeConfig.title == '默认'
    }
  }
}
</script>

<style></style>
